package com.studiofortress.sf.util.collections;

/**
 * This is for defining objects that can be passed into collections for
 * iteration. The iterate method on this object is called for each item in the
 * collection.
 *
 * The intention is to invert the object creation from the typically built
 * iterator that the collection would make to an instance of this object that
 * the develop builds. The advantage is that you can re-use instances of this
 * IteratorCallback, whilst you can't with Iterators.
 *
 * @author Joseph Lenton - JosephLenton@StudioFortress.com
 * @param V The type of value that this iterator is iterating over.
 */
public interface CallbackIterator<V>
{
    /**
     * This will be called on each iteration of the collection using this. The
     * value will be passed in.
     * @param value The current value to iterate over in the collection.s
     */
    public abstract void iterate(V value);
}
